package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.CartypeMapper;
import com.ruoyi.zhhq.domain.Cartype;
import com.ruoyi.zhhq.service.ICartypeService;

/**
 * 车辆类别Service业务层处理
 * 
 * @author Anthony Lu
 * @date 2022-11-09
 */
@Service
public class CartypeServiceImpl implements ICartypeService 
{
    @Autowired
    private CartypeMapper cartypeMapper;

    /**
     * 查询车辆类别
     * 
     * @param typeId 车辆类别主键
     * @return 车辆类别
     */
    @Override
    public Cartype selectCartypeByTypeId(String typeId)
    {
        return cartypeMapper.selectCartypeByTypeId(typeId);
    }

    /**
     * 查询车辆类别列表
     * 
     * @param cartype 车辆类别
     * @return 车辆类别
     */
    @Override
    public List<Cartype> selectCartypeList(Cartype cartype)
    {
        return cartypeMapper.selectCartypeList(cartype);
    }

    /**
     * 新增车辆类别
     * 
     * @param cartype 车辆类别
     * @return 结果
     */
    @Override
    public int insertCartype(Cartype cartype)
    {
        cartype.setCreateTime(DateUtils.getNowDate());
        return cartypeMapper.insertCartype(cartype);
    }

    /**
     * 修改车辆类别
     * 
     * @param cartype 车辆类别
     * @return 结果
     */
    @Override
    public int updateCartype(Cartype cartype)
    {
        cartype.setUpdateTime(DateUtils.getNowDate());
        return cartypeMapper.updateCartype(cartype);
    }

    /**
     * 批量删除车辆类别
     * 
     * @param typeIds 需要删除的车辆类别主键
     * @return 结果
     */
    @Override
    public int deleteCartypeByTypeIds(String[] typeIds)
    {
        return cartypeMapper.deleteCartypeByTypeIds(typeIds);
    }

    /**
     * 删除车辆类别信息
     * 
     * @param typeId 车辆类别主键
     * @return 结果
     */
    @Override
    public int deleteCartypeByTypeId(String typeId)
    {
        return cartypeMapper.deleteCartypeByTypeId(typeId);
    }
}
